from flask import Blueprint,jsonify
from flask_restful import Api,Resource


admin_bp = Blueprint('admin_view',__name__,url_prefix='/admin')

# 封装返回值
class BaseView(Resource):
    '''正确返回值'''
    def success(self,msg=None,data=None):
        if data == None:
            data = {}

        return jsonify({
            'code': 200,
            'msg': msg,
            'data': data
        })

    def error(self,msg=None,data=None):
        if data == None:
            data = {}
        return jsonify({
            'code': 400,
            'msg': msg,
            'data': data
        })


from views.admin.user import *

api = Api(admin_bp)



















